package com.rainng.coursesystem.model.bo;

import com.rainng.coursesystem.model.constant.UserType;
import lombok.Data;

import java.io.Serializable;

@Data
public class RegisterStatusBO implements Serializable {
    private Boolean signedIn = false;
    private String number;
    private String password;
    private Integer userType = UserType.NO;
    private Integer permission = 0;

    public static RegisterStatusBO fromAuthInfo(AuthInfoBO authInfo) {
        RegisterStatusBO registerStatus = new RegisterStatusBO();
        registerStatus.signedIn = true;
        authInfo.setUsername(registerStatus.number);
        authInfo.setPassword(registerStatus.password);
        authInfo.setUserType(registerStatus.userType);
        authInfo.setPermission(registerStatus.permission);
        return registerStatus;
    }

    public Boolean getSignedIn() {
        return signedIn;
    }

    public void setSignedIn(Boolean signedIn) {
        this.signedIn = signedIn;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number
        ;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Integer getPermission() {
        return permission;
    }

    public void setPermission(Integer permission) {
        this.permission = permission;
    }
}
